package group2.service.impl;


import group2.mapper.BookMapper;
import group2.model.Book;
import group2.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周祖航
 * @date 2020/8/19 001911:48
 **/
@Service("bookService")
public class BookServiceImpl implements BookService {
    @Autowired
    BookMapper bookMapper;

    @Override
    public List<Book> selectAll() {
        return bookMapper.selectAll();
    }

    @Override
    public boolean delBookById(int id){
        return bookMapper.delBookById(id);
    }

    @Override
    public boolean addBook(Book book){
        return bookMapper.addBook(book);
    }

    //条件查询
    @Override
    public List<Book> selectBook(Book book){
        List<Book> list = bookMapper.selectBook(book);
        System.out.println(list.toString());
        return list;
    }


}
